package action.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import biz.CategoryBiz;
import biz.FoodBiz;
import biz.impl.CategoryBizImpl;
import biz.impl.FoodBizImpl;
import entity.Category;
import entity.Food;

public class DetailsServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		CategoryBiz cd = new CategoryBizImpl();
		List<Category> categorylist =cd.getCategory();
		String fid=request.getParameter("fid");
		int id=Integer.parseInt(fid);
		FoodBiz fb = new FoodBizImpl();
		Food food = fb.getDetailsMeun(id);
		
		request.setAttribute("food", food);
        request.setAttribute("categorylist", categorylist);
        request.getRequestDispatcher("details.jsp").forward(request, response);
	}


}
